<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta lang="zh">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>阿福易购后台管理-登录</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <link href="{{ asset("/components/AdminLTE/bootstrap/css/bootstrap.min.css") }}" rel="stylesheet" type="text/css" />
    <!-- Font Awesome -->
    <link href="{{ asset("/components/AdminLTE/font-awesome/css/font-awesome.min.css") }}" rel="stylesheet" type="text/css" />
    <!-- Ionicons -->
    <link href="{{ asset("/components/AdminLTE/ionicons/css/ionicons.min.css") }}" rel="stylesheet" type="text/css" />
    <!-- Theme style -->
    <link rel="stylesheet" href="{{asset("/components/AdminLTE/dist/css/AdminLTE.min.css")}}">
    <!-- iCheck -->

    <link rel="stylesheet" href="{{asset("/components/AdminLTE/plugins/iCheck/square/blue.css")}}">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="{{ asset ("/components/html5shiv/dist/html5shiv.min.js") }}"></script>
    <script src="{{ asset ("/components/respond/dist/respond.min.js") }}"></script>
    <![endif]-->
    <!-- jQuery 2.1.4 -->
    <script src="{{ asset ("/components/AdminLTE/plugins/jQuery/jQuery-2.1.4.min.js") }}"></script>

    <!-- Bootstrap 3.3.5 -->
    <script src="{{ asset ("/components/AdminLTE/bootstrap/js/bootstrap.min.js") }}"></script>
</head>
<body class="hold-transition login-page">

<div class="login-box">
    <div class="login-logo">
        <a href="">阿福易购后台管理</a>
    </div>
    <!-- /.login-logo -->
    <div class="login-box-body">
        <p class="login-box-msg">后台登录</p>

        {!! Form::open(['route'=>'admin.login.store']) !!}
            <div class="form-group has-feedback @if($errors->has('user_name')) has-error   @endif">
            {!! Form::text('user_name',old('user_name'),array('id'=>'user_name', 'class'=>'form-control','placeholder'=>'用户名','required'=>'required'))!!}
                <span class="glyphicon glyphicon-user form-control-feedback"></span>
                @if($errors->has('user_name'))
                    <label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i> {{$errors->first('user_name')}}</label>
                @endif
            </div>
        <div class="form-group has-feedback @if($errors->has('password')) has-error   @endif">
        {!! Form::input('password','password',old('password'),array('id'=>'password', 'class'=>'form-control','autocomplete'=>'off','placeholder'=>'密码','required'=>'required'))!!}
            <span class="glyphicon glyphicon-lock form-control-feedback"></span>
            @if($errors->has('password'))
                <label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i> {{$errors->first('password')}}</label>
            @endif
        </div>
        <div class="form-group has-feedback @if($errors->has('chkCode')) has-error   @endif">
            <input type="text" name="chkCode" style="width:170px;float:left;" class="form-control" placeholder="请输入验证码" required="required">
            <a class="chk-code" href="#"> <img style="margin: 0 6px;height: 34px;" src="" alt="" id="chkCode" onclick="javascript:re_captcha();"></a>
            <span><a href="javascript:;" class="text-color-8" onclick="javascript:re_captcha();">换一张</a></span>
            @if($errors->has('chkCode'))
                <label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i> {{$errors->first('chkCode')}}</label>
            @endif
        </div>

            <div class="form-group has-feedback @if($errors->has('result')) has-error   @endif">
                @if($errors->has('result'))
                    <label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i> {{$errors->first('result')}}</label>
                @endif
            </div>
            <div class="row">

                <!-- /.col -->
                <div class="col-xs-12   ">
                    <button type="submit" class="btn btn-primary btn-block btn-flat">登录</button>
                </div>
                <!-- /.col -->
            </div>
        {!! Form::close() !!}

    </div>
    <!-- /.login-box-body -->
</div>
<!-- /.login-box -->
<script src="{{ asset ("/components/AdminLTE/plugins/iCheck/icheck.min.js") }}"></script>

<script>
    $(function () {
        $('input').iCheck({
            checkboxClass: 'icheckbox_square-blue',
            radioClass: 'iradio_square-blue',
            increaseArea: '20%' // optional
        });
    });

    function re_captcha() {
        var $url = "{{ URL('admin/captcha') }}" + "/" + Math.random();
        $('#chkCode').attr('src',$url);
    }
    re_captcha();
</script>
</body>
</html>
